package cn.getech.data.development.entity.flink;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

@Data
@TableName(value = "bdp_real_table_info")
public class BdpRealTableInfo implements Serializable {
    /**
     * 编号
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 资源id
     */
    @TableField(value = "resource_id")
    private Integer resourceId;

    /**
     * 表名称
     */
    @TableField(value = "table_name")
    private String tableName;


    /**
     * 库名称
     */
    @TableField(value = "db_name")
    private String dbName;

    /**
     * topic
     */
    @TableField(value = "topic_name")
    private String topicName;

    /**
     * 分隔符
     */
    @TableField(value = "delimit_id")
    private Integer delimitId;

    /**
     * 格式
     */
    @TableField(value = "format")
    private String format;

    /**
     * 描述信息
     */
    @TableField(value = "table_desc")
    private String tableDesc;

    /**
     * 其他参数
     */
    @TableField(value = "config")
    private String config;

    /**
     * 访问记录
     */
    @TableField(value = "view_num")
    private Integer viewNum;

    /**
     * 创建理时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 创建人
     */
    @TableField(value = "create_user")
    private Long createUser;

    /**
     * 更新人
     */
    @TableField(value = "update_user")
    private Long updateUser;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private Date updateTime;

    /**
     * 删除 1 是,0 否
     */
    @TableField(value = "delete_flag")
    private Integer deleteFlag;


    /**
     * 内部部表 1   外部表 2
     */
    @TableField(value = "table_type")
    private Integer tableType;
    /**
     * 类目id
     */
    @TableField(exist = false)
    private Integer categoryId;
    /**
     * 主题id
     */
    @TableField(exist = false)
    private Integer subjectId;
    /**
     * 是否分区  1是 0 否
     */
    @TableField(value = "partition_flag")
    private Integer partitionFlag;
    /**
     * 分区数
     */
    @TableField(value = "partition_num")
    private Integer partitionNum;
    /**
     * 副本数
     */
    @TableField(value = "duplicate_num")
    private Short duplicateNum;

    @TableField("security_data_level")
    private String securityDataLevel;


    @TableField("table_level_id")
    private Integer tableLevelId;
    @TableField("tenant_id")
    private Integer tenantId;
    private static final long serialVersionUID = 1L;

    @TableField(exist = false)
    private  String createPerName;
    @TableField(exist = false)
    private  String updatePerName;
    @TableField(exist = false)
    private  String projectName;
    @TableField(exist = false)
    private Integer quoteNum;
    /**
     * 申请状态
     */
    @TableField(exist = false)
    private Integer applyStatus;

    /**
     * 申请id
     */
    @TableField(exist = false)
    private Integer applyId;

    @TableField(exist = false)
    private String levelName;
    /**
     * 主题
     */
    @TableField(exist = false)
    private String subjectName;
    //主题域
    @TableField(exist=false)
    private String subjectArea;
    /**
     * 有效期
     */
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime effectiveDeadline;


    public Integer getStoreType() {
       // 1离线表  2 实时表
        return 2;
    }

    public BdpRealTableInfo(){}

    public BdpRealTableInfo(Integer id, Integer resourceId, String tableName, String topicName, Integer delimitId, String format, String desc, String config) {
        this.id = id;
        this.resourceId = resourceId;
        this.tableName = tableName;
        this.topicName = topicName;
        this.delimitId = delimitId;
        this.format = format;
        this.tableDesc = desc;
        this.config = config;
    }
}